package com.efesco.payroll.classItem;

import com.bstek.dorado.view.AbstractViewModel;
import com.bstek.dorado.common.DoradoContext;
import com.bstek.dorado.data.*;
import com.bstek.dorado.view.data.*;
import com.bstek.dorado.view.control.*;
import com.bstek.dorado.data.db.DBStatement;

/**
 * displayOrderViewModel
 */
public class displayOrderViewModel extends AbstractViewModel {
	public void setComputerOrder(ParameterSet parameters) throws Exception {
		Dataset dataset = getDataset("datasetDisplayOrder");

		RecordIterator ri = dataset.recordIterator();
		// dataset.re
		// ri.setVisibility(Dataset.FILTER_ALL);
		// int i=1;
		
		String sql="";
		
		while (ri.hasNext()) {
			Record record = ri.nextRecord();
			sql="update s_wa_classitem set display_order="+record.getString("display_order")+" "
			   +"where wa_classitem_id="+record.getString("wa_classitem_id");	
			DBStatement statement = new DBStatement();
			statement.setSql(sql);
			statement.execute();
			statement.close();
			// record.setValue("compute_order",new Integer(i));
			// i++;
		}
		
	}
}
